package cn.zwx.member.svc.facade;

import cn.zwx.base.entity.ResponseEntity;
import cn.zwx.base.exception.BizWrapException;
import cn.zwx.member.svc.dto.MemberConfigSaveDTO;
import cn.zwx.member.svc.fallback.MemberConfigFallback;
import cn.zwx.member.svc.vo.MemberConfigVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * @author zhangwenxue
 */
@FeignClient(name = "member-svc",path = "/member/config")
public interface MemberConfigApi extends FallbackFactory<MemberConfigFallback> {

    @PostMapping
    MemberConfigFallback create(Throwable cause);

    @PutMapping("/save")
    @ApiOperation("保存会员配置")
    ResponseEntity<Boolean> saveConfig(@Valid @RequestBody MemberConfigSaveDTO saveReqVO);


    @GetMapping("/get")
    @ApiOperation("获取会员配置信息")
    ResponseEntity<MemberConfigVO> getConfig() throws BizWrapException;
}
